<% from models.utils import trunc_utf8 %>
<%page args="partial"/>
<section class="widget blogroll">
  <h5>${ partial.title if 'title' in partial else 'Recent Comments' }</h5>

  <ul class="list-inline">
    % for comment in latest_comments:
    <li class="list-item comment">
      <div class="avatar">
        <a href="${ comment.user.link }">
          <img alt="@${ comment.user.name }" height="44" src="${ comment.user.avatar }" width="44">
        </a>
      </div>
      <div class="body">
        <span><a class="user" href="${ comment.user.link }" target="_blank">${ comment.user.name }</a> </span>
        <div class="content"><p>${ trunc_utf8(comment.content, partial.max_length) if 'max_length' in partial else comment.content }</p>
        </div>
      </div>

      <div class="meta">
        <span class="title">${ comment.post.title }</span> | <span class="date">${ comment.date }</span>
      </div>
    </li>
    % endfor
  </ul>
</section>
